<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算出一个字符串共有多少个单词组成</title>
</head>
<body>
<script>
  function countWords(message){
   return  message.split(' '||',').length;
    // wirte your code here
  }
  document.write(countWords('Good morning, I love JavaScript.')); // should return 5
</script>
</body>
</html>